<?xml version="1.0" encoding="UTF-8"?>
<html filename="docs/SAX/IParser.html">
<body>
<a id="#top"/>
<h1>
	                Interface Summary : IParser </h1> Basic interface for SAX (Simple API for XML) parsers.

 <blockquote>
 <em>This module, both source code and documentation, is in the
 Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
 </blockquote>

 <p>This was the main event supplier interface for SAX1; it has
 been replaced in SAX2 by <a href="../SAX/IXMLReader.html">IXMLReader</a>,
 which includes Namespace support and sophisticated configurability
 and extensibility.</p>

 <p>All SAX1 parsers must implement this basic interface: it allows
 applications to register handlers for different types of events
 and to initiate a parse from a URI, or a character stream.</p>

 <p>All SAX1 parsers must also implement a zero-argument constructor
 (though other constructors are also allowed).</p>

 <p>SAX1 parsers are reusable but not re-entrant: the application
 may reuse a parser object (possibly with a different input source)
 once the first parse has completed successfully, but it may not
 invoke the parse() methods recursively within a parse.</p>

<br/><b>Deprecated : </b> This interface has been replaced by the SAX2
             {@IXMLReader IXMLReader}
             interface, which includes Namespace support.
<br/><b>Since : </b> SAX 1.0
<br/><b>See : </b> <a href="../SAX/IEntityResolver.html">IEntityResolver</a>
<br/><b>See : </b> <a href="../SAX/IDTDHandler.html">IDTDHandler</a>
<br/><b>See : </b> <a href="../SAX/IDocumentHandler.html">IDocumentHandler</a>
<br/><b>See : </b> <a href="../SAX/IErrorHandler.html">IErrorHandler</a>
<br/><b>See : </b> <a href="../SAX/TInputSource.html">TInputSource</a>
<h2>
	              Methods
	            </h2>
<div style="padding-left:10px">
<a href="#setLocale">
	                  procedure
	                 setLocale(SAXString)</a>
<br/>
<a href="#setEntityResolver">
	                  procedure
	                 setEntityResolver(IEntityResolver)</a>
<br/>
<a href="#setDTDHandler">
	                  procedure
	                 setDTDHandler(IDTDHandler)</a>
<br/>
<a href="#setDocumentHandler">
	                  procedure
	                 setDocumentHandler(IDocumentHandler)</a>
<br/>
<a href="#setErrorHandler">
	                  procedure
	                 setErrorHandler(IErrorHandler)</a>
<br/>
<a href="#parse">
	                  procedure
	                 parse(IInputSource)</a>
<br/>
<a href="#parse">
	                  procedure
	                 parse(SAXString)</a>
<br/>
</div>
<br/>
<hr width="100%"/>
<a name="#setLocale">
<p>
<b>procedure</b> setLocale(<b>const</b> locale : SAXString); </p>
</a> Allow an application to request a locale for errors and warnings.

 <p>SAX parsers are not required to provide localisation for errors
 and warnings; if they cannot support the requested locale,
 however, they must throw a SAX exception.  Applications may
 not request a locale change in the middle of a parse.</p>

<br/><b>Parameter : </b> locale A string representing the locale.  This can be used
            to determine a locale for the specific system
<br/><b>Exception : </b> ESAXException Throws an exception
            (using the previous or default locale) if the
            requested locale is not supported.
<br/><b>See : </b> <a href="../SAX/ESAXException.html">ESAXException</a>
<br/><b>See : </b> <a href="../SAX/ESAXParseException.html">ESAXParseException</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setEntityResolver">
<p>
<b>procedure</b> setEntityResolver(<b>const</b> resolver : IEntityResolver); </p>
</a> Allow an application to register a custom entity resolver.

 <p>If the application does not register an entity resolver, the
 SAX parser will resolve system identifiers and open connections
 to entities itself</p>

 <p>Applications may register a new or different entity resolver
 in the middle of a parse, and the SAX parser must begin using
 the new resolver immediately.</p>

<br/><b>Parameter : </b> resolver The object for resolving entities.
<br/><b>See : </b> <a href="../SAX/IEntityResolver.html">IEntityResolver</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setDTDHandler">
<p>
<b>procedure</b> setDTDHandler(<b>const</b> handler : IDTDHandler); </p>
</a> Allow an application to register a DTD event handler.

 <p>If the application does not register a DTD handler, all DTD
 events reported by the SAX parser will be silently
 ignored</p>

 <p>Applications may register a new or different
 handler in the middle of a parse, and the SAX parser must
 begin using the new handler immediately.</p>

<br/><b>Parameter : </b> handler The DTD handler.
<br/><b>See : </b> <a href="../SAX/IDTDHandler.html">IDTDHandler</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setDocumentHandler">
<p>
<b>procedure</b> setDocumentHandler(<b>const</b> handler : IDocumentHandler); </p>
</a> Allow an application to register a document event handler.

 <p>If the application does not register a document handler, all
 document events reported by the SAX parser will be silently
 ignored</p>

 <p>Applications may register a new or different handler in the
 middle of a parse, and the SAX parser must begin using the new
 handler immediately.</p>

<br/><b>Parameter : </b> handler The document handler.
<br/><b>See : </b> <a href="../SAX/IDocumentHandler.html">IDocumentHandler</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setErrorHandler">
<p>
<b>procedure</b> setErrorHandler(<b>const</b> handler : IErrorHandler); </p>
</a> Allow an application to register an error event handler.

 <p>If the application does not register an error event handler,
 all error events reported by the SAX parser will be silently
 ignored, except for fatalError, which will throw a ESAXException</p>

 <p>Applications may register a new or different handler in the
 middle of a parse, and the SAX parser must begin using the new
 handler immediately.</p>

<br/><b>Parameter : </b> handler The error handler.
<br/><b>See : </b> <a href="../SAX/IErrorHandler.html">IErrorHandler</a>
<br/><b>See : </b> <a href="../SAX/ESAXException.html">ESAXException</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#parse">
<p>
<b>procedure</b> parse(<b>const</b> input : IInputSource); </p>
</a> Parse an XML document.

 <p>The application can use this method to instruct the SAX parser
 to begin parsing an XML document from any valid input
 source (a character stream, a byte stream, or a URI).</p>

 <p>Applications may not invoke this method while a parse is in
 progress (they should create a new IParser instead for each
 additional XML document).  Once a parse is complete, an
 application may reuse the same IParser object, possibly with a
 different input source.</p>

<br/><b>Parameter : </b> source The input source for the top-level of the
        XML document.
<br/><b>Exception : </b> ESAXException Any SAX exception.
<br/><b>Exception : </b> Exception An IO exception from the parser,
            possibly from a byte stream or character stream
            supplied by the application.
<br/><b>See : </b> <a href="../SAX/TInputSource.html">TInputSource</a>
<br/><b>See : </b> <a href="../SAX/IParser.html#parse.SAXString">IParser.parse(SAXString)</a>
<br/><b>See : </b> <a href="../SAX/IParser.html#setEntityResolver">IParser.setEntityResolver</a>
<br/><b>See : </b> <a href="../SAX/IParser.html#setDTDHandler">IParser.setDTDHandler</a>
<br/><b>See : </b> <a href="../SAX/IParser.html#setDocumentHandler">IParser.setDocumentHandler</a>
<br/><b>See : </b> <a href="../SAX/IParser.html#setErrorHandler">IParser.setErrorHandler</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#parse">
<p>
<b>procedure</b> parse(<b>const</b> systemId : SAXString); </p>
</a> Parse an XML document from a system identifier (URI).

 <p>This method is a shortcut for the common case of reading a
 document from a system identifier.  It is the exact
 equivalent of the following:</p>

 <pre>
 input:= TInputSource.Create(systemId) as IInputSource;
 try
   parse(input);
 finally
   input:= nil;
 end;
 </pre>

 <p>If the system identifier is a URL, it must be fully resolved
 by the application before it is passed to the parser.</p>

<br/><b>Parameter : </b> systemId The system identifier (URI).
<br/><b>Exception : </b> ESAXException Any SAX exception.
<br/><b>Exception : </b> Exception An IO exception from the parser,
            possibly from a byte stream or character stream
            supplied by the application.
<br/><b>See : </b> <a href="../SAX/IParser.html#parse.TInputSource">IParser.parse(TInputSource)</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
</body>
</html>